import request from "@/utils/request"
import { HospitalDepartmentData, HospitalDetailResponseData, HospitalDoctorParams, HospitalDoctorResponseData, HospitalWorkResponseData, ScheduleInfoData } from "./type"

export const getHospitalDetailAPI = (hoscode: string) => {
    return request<any, HospitalDetailResponseData>({
        url: `/hosp/hospital/${hoscode}`
    })
}

export const getDepartmentAPI = (hoscode: string) => {
    return request<any, HospitalDepartmentData>({
        url: `/hosp/hospital/department/${hoscode}`
    })
}

export const getCodeAPI = (phone: string) => {
    return request<any, any>({
        url: `/sms/send/${phone}`
    })
}

export const getHospitalRegisterAPI = (page: number, limit: number, hoscode: string, depcode: string) => {
    return request<any, HospitalWorkResponseData>({
        url: `/hosp/hospital/auth/getBookingScheduleRule/${page}/${limit}/${hoscode}/${depcode}`
    })
}

export const getDoctorWorkAPI = (params: HospitalDoctorParams) => {
    return request<any, HospitalDoctorResponseData>({
        url: `/hosp/hospital/auth/findScheduleList/${params.hoscode}/${params.depcode}/${params.workDate}`
    })
}

export const getDoctorAPI = (scheduleId: string) => {
    return request<any, ScheduleInfoData>({
        url: `/hosp/hospital/getSchedule/${scheduleId}`
    })
}